<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title>wysiwyg-sceditor</title>

  <!-- json editor -->
  <script src="../../dist/jsoneditor.js"></script>

  <!-- jquery -->
  <script src="./../../node_modules/jquery/dist/jquery.min.js"></script>

  <!-- sceditor -->
  <script src="./../../node_modules/sceditor/minified/jquery.sceditor.bbcode.min.js"></script>
  <script src="./../../node_modules/sceditor/minified/jquery.sceditor.xhtml.min.js"></script>
  <link rel="stylesheet" href="./../../node_modules/sceditor/minified/themes/default.min.css">
</head>
<body>

<h1>Test</h1>
<label for="debug">Value</label>
<textarea id="debug" class="debug" cols="30" rows="10"></textarea>
<button class='get-value'>Get Value</button>
<div class='container'></div>

<script>
  var container = document.querySelector('.container');
  var debug = document.querySelector('.debug');

  var schema = {
    "type": "array",
    "title": "string-sceditor",
    "items": {
      "type": "object",
      "properties": {
        "editor": {
          "type": "string",
          "format": "xhtml",
          "options": {
          }
        }
      }
    }
  };

  // sceditor quirk. Styles must be specified in the options at creation
  // if you want to be able to focus on the iframes he creates.

  JSONEditor.defaults.options.sceditor = {
    //style: '//cdn.jsdelivr.net/sceditor/1.4.3/jquery.sceditor.default.min.css'
    style: ''
  };
  var editor = new JSONEditor(container, {
    schema: schema
  });

  document.querySelector('.get-value').addEventListener('click', function () {
    debug.value = JSON.stringify(editor.getValue());
  });

</script>

</body>
</html>
